package com.hoshiicloud.lessee.feign.hystrix;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hoshiicloud.common.query.OmnipotentWrapper;
import com.hoshiicloud.common.rpc.Response;
import com.hoshiicloud.lessee.feign.ShopSaleOrderFeignService;
import com.hoshiicloud.saleorder.entity.*;
import com.hoshiicloud.saleorder.param.OrderInfoUpdateParam;
import com.hoshiicloud.saleorder.param.OrderMainUpdateParam;
import com.hoshiicloud.saleorder.param.refund.RefundOrderListParam;
import com.hoshiicloud.saleorder.param.refund.RefundOrderPageParam;
import com.hoshiicloud.saleorder.vo.refund.RefundOrderVo;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * 2019/8/23 11:07
 */
@Slf4j
public class ShopSaleOrderFeignServiceFallback implements FallbackFactory<ShopSaleOrderFeignService> {
    @Override
    @HystrixCommand
    public ShopSaleOrderFeignService create(Throwable throwable) {
        return new ShopSaleOrderFeignService() {
            @Override
            public Response<List<OrderMain>> omniQueryOrderMain(List<OmnipotentWrapper> wrappers) {
                return Response.failed("根据主订单ID集合查询主订单信息失败"+throwable.getMessage());
            }

        };
    }
}
